<?php 
/**
 * oauth相关
 *
 */

class Oauth2 extends ApiController{

	public function getauthurl() {
		$o = new SaeTOAuthV2( SINAWB_AKEY , SINAWB_SKEY );
		$code_url = $o->getAuthorizeURL( SINAWB_CALLBACK_URL, 'code', NULL, 'mobile' );
		return array('url' => $code_url);
	}

	public function login() {
		if ($_SESSION['token']['access_token']) {
			return $_SESSION['token'];
		}
	}
}